package com.battery.system.service.battery.impl;

import java.util.Date;
import java.util.List;

import com.battery.system.domain.Used;
import com.battery.system.domain.VO.UsedLineVO;
import com.battery.system.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.battery.system.mapper.UsedBasicsMapper;
import com.battery.system.domain.UsedBasics;
import com.battery.system.service.battery.IUsedBasicsService;
import com.battery.common.core.text.Convert;
import tk.mybatis.mapper.entity.Example;

/**
 * 租借依据Service业务层处理
 *
 * @author battery
 * @date 2021-01-22
 */
@Service
public class UsedBasicsServiceImpl extends BaseServiceImpl<UsedBasics> implements IUsedBasicsService {


    @Autowired
    private UsedBasicsMapper usedBasicsMapper;

    /**
     * 查询租借依据
     *
     * @param usedId 租借依据ID
     * @return 租借依据
     */
    @Override
    public UsedBasics selectUsedBasicsById(String usedId) {
        return usedBasicsMapper.selectUsedBasicsById(usedId);
    }

    /**
     * 查询租借依据列表
     *
     * @param usedBasics 租借依据
     * @return 租借依据
     */
    @Override
    public List<UsedBasics> selectUsedBasicsList(UsedBasics usedBasics) {
        return usedBasicsMapper.selectUsedBasicsList(usedBasics);
    }

    /**
     * 新增租借依据
     *
     * @param usedBasics 租借依据
     * @return 结果
     */
    @Override
    public int insertUsedBasics(UsedBasics usedBasics) {
        return usedBasicsMapper.insertUsedBasics(usedBasics);
    }

    /**
     * 修改租借依据
     *
     * @param usedBasics 租借依据
     * @return 结果
     */
    @Override
    public int updateUsedBasics(UsedBasics usedBasics) {
        return usedBasicsMapper.updateUsedBasics(usedBasics);
    }

    /**
     * 删除租借依据对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteUsedBasicsByIds(String ids) {
        return usedBasicsMapper.deleteUsedBasicsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除租借依据信息
     *
     * @param usedId 租借依据ID
     * @return 结果
     */
    @Override
    public int deleteUsedBasicsById(String usedId) {
        return usedBasicsMapper.deleteUsedBasicsById(usedId);
    }

    /**
     * @param appUserId 用户ID
     * @param nowDate
     * @param sn
     * @return
     */
    @Override
    public UsedLineVO selectLineInRun(String appUserId, Date nowDate, String sn) {
        return usedBasicsMapper.selectLineInRun(appUserId, nowDate, sn);
    }
}
